<%--
  Created by IntelliJ IDEA.
  User: HUAWEI
  Date: 2021-12-23
  Time: 12:11
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html;charset = utf-8"/>
        <title>Title</title>
    </head>
    <body>
        学生列表
        <table class="table table-bordered table-striped">
            <thead>
            <tr>
                <th>ID</th>
                <th>姓名</th>
                <th>专业</th>
            </tr>
            </thead>
            <tbody>

            <c:forEach items="${students}" var="student">
                <tr>
                    <td>${student.id}</td>
                    <td>${student.name}</td>
                    <td>${student.major}</td>
                    <td>
                        <a onclick="location.href='#'" class="btn btn-primary btn-xs" data-toggle="modal"
                           data-target="#customerEditDialog">修改</a>
                        <a href="#" class="btn btn-danger btn-xs" onclick="deleteStudent(${student.id})">删除</a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>


        <!-- 底部导航 -->
        <footer class="main-footer">
            <div class="pull-right hidden-xs">
                <b>Version</b> 1.0.8
            </div>
            <strong>Copyright &copy; 杨成斌2019211670 <a
                    href="https://gitee.com/Unicat/FinalWork">JavaEE课程作业</a>.
            </strong> All rights reserved.
        </footer>
        <!-- 底部导航 /-->

        <script>
            function deleteStudent(id) {
                if (confirm('确实要删除该学生吗?')) {
                    location.href = "#?id=" + id;
                }
            }
        </script>

    </body>
</html>
